<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>transition</title>
    <script src="../js/vue.min.js"></script>
    <link href="https://unpkg.com/animate.css@3.5.1/animate.min.css" rel="stylesheet" type="text/css">
</head>
<style>
    .fade-enter-active, .fade-leave-active {
        transition: opacity .5s
    }
    .fade-enter, .fade-leave-active {
        opacity: 0
    }

    .slide-fade-enter-active {
        transition: all .3s ease;
    }
    .slide-fade-leave-active {
        transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
    }
    .slide-fade-enter, .slide-fade-leave-active {
        transform: translateX(10px);
        opacity: 0;
    }
</style>
<body>
<div id="demo">
    <button v-on:click="show = !show">
        Toggle
    </button>
    <transition name="fade">
        <p v-if="show">hello</p>
    </transition>

    <button @click="show2 = !show2">
        Toggle render
    </button>
    <transition name="slide-fade">
        <p v-if="show2">hello</p>
    </transition>


    <button @click="show3 = !show3">
        Toggle render
    </button>
    <transition
            name="custom-classes-transition"
            enter-active-class="animated tada"
            leave-active-class="animated bounceOutRight"
    >
        <p v-if="show3">hello</p>
    </transition>


    <pre>
我们可以通过以下特性来自定义过渡类名：
enter-class
enter-active-class
leave-class
leave-active-class
他们的优先级高于普通的类名
    </pre>
</div>
<script>
    new Vue({
        el: '#demo',
        data: {
            show: true,
            show2:true,
            show3:true
        }
    })
</script>
</body>
</html>
